package file;

import java.io.File;
import java.io.FileFilter;

/** 文件过滤器Lambda版 */
public class ListFilesDemo3 {
    public static void main(String[] args) {
        File d = new File(".");
        if (d.isDirectory()){
            File[] s = d.listFiles(file -> file.getName().endsWith(".txt"));
            for (File s1 : s){
                System.out.println(s1.getName());
            }
        }
    }
}
